package com.atguigu.mediator.smarthouse;

public class Client {

	public static void main(String[] args) {
		// 创建一个中介者对象
		Mediator mediator = new MediatorExt();

		// 创建 Alarm， 并且加入到 ConcreteMediator 对象的HashMap
		ColleagueForAlarm alarm = new ColleagueForAlarm(mediator, "alarm");

		// 创建 CoffeeMachine，并 且加入到 ConcreteMediator 对象的HashMap
		ColleagueForCoffeeMachine coffeeMachine = new ColleagueForCoffeeMachine(mediator, "coffeeMachine");

		// 创建 Curtains, 并 且加入到 ConcreteMediator 对象的HashMap
		ColleagueForCurtains curtains = new ColleagueForCurtains(mediator, "curtains");
		
		ColleagueForTV tv = new ColleagueForTV(mediator, "TV");
		

		// 让闹钟发出消息
		alarm.sendAlarm(0);
		alarm.sendMessage(0);
		
		//
		coffeeMachine.finishCoffee();
		//alarm.sendAlarm(1);
	}

}
